<?php
class IndexAction extends BaseAction {
	
    public function index(){
    	
    	$runtime = new Runtime();
    	$runtime->begin();
    	
		//网站基本配置
		$config = WebConfigHelper::getObject();
		$config["footer_cont"] = htmlspecialchars_decode($config["footer_cont"]);
		$config = CommonUtil::appendCustomerJSconfig($config);	//合并[脚本JS代码 & 客服JS代码]
		
		//SEO数据
		$seo = array();
		$seo["title"] = $config["index_seo_title"];
		$seo["keywords"] = $config["index_seo_keywords"];
		$seo["description"] = $config["index_seo_description"];
		
		$this->assign("config",$config);
		$this->assign("template_path",CommonUtil::getDir()."/themes/".$config["template_name"]);
    	$this->assign("seo",$seo);
    	$this->assign("is_index",true);
    	
		$this->display(CommonUtil::getTemplatePath()."index.html");
		$runtime->end();
		
		echo "<!-- 页面执行时间{$runtime->spent()}秒 Power by 4jcms -->";
		
    }
    
    public function test(){
    	
    	$_fieldresult = CatalogHelper::getList ( 'pid=0', 'order_num DESC', 0 );
		foreach ( $_fieldresult as $fieldkey => $field ) :
			$field ["first"] = $fieldkey == 0 ? true : false;
			$field ["last"] = $fieldkey == (count ( $_fieldresult ) - 1) ? true : false;
			$field ["current"] = $field ["catalog_id"] == $current_catalog ["catalog_id"] ? true : false;
			$field ["link"] = LinkUtil::getCataLink ( $field );
			
			echo "haha";
			
		endforeach
		;
    	
    }
    
    
}